In [56]:
from owslib.wms import WebMapService
import matplotlib.pyplot as plt
import matplotlib.image as mpimg
from ipywidgets import widgets,interact
In [57]:
wms=WebMapService('http://mapy.geoportal.gov.pl/wss/service/img/guest/Administracyjna/MapServer/WMSServer')
Please provide a bounding box (comma separated) longitude min, latitude min, longitude max latitude max
In [78]:
from IPython.display import display
bbox=widgets.Text()
display(bbox)
In [99]:
bb=bbox.value.split(',')
bb=tuple([float(x) for x in bb])
In [100]:
img = wms.getmap(layers=['Administracyjna'],styles=['default'],srs='EPSG:4326',bbox=bb,size=(1800,1600),format='image/jpeg',transparent=False)
In [101]:
out=open('obrazek.jpg','wb')
In [102]:
out.write(img.read())
out.close()
In [103]:
obr=mpimg.imread('obrazek.jpg')
imgplot = plt.imshow(obr)
plt.show()
In [ ]: